<?php
require '../../loader.php';
class Pes extends WDB\BaseObject
{
  private $delkaOcasu;
  private $hracky = array('kost','jina kost');
  public function setDelkaOcasu($value)
  {
    if ($value > 100) throw new TailTooLongException();
    else $this->delkaOcasu = $value;  
  }
  public function getDelkaOcasu()
  {
    return $this->delkaOcasu;  
  }
  public function getHracky()
  {
    return $this->hracky;
  }
}
$p = new Pes();
echo $p->hracky[0]; //vypíše "kost"
$p->delkaOcasu = 101; //vyvolá TailTooLongException

//pokud bychom neměli BaseObject, museli bychom použít tento zápis:
$h = $p->getHracky();
echo $h[0];
$p->setDelkaOcasu(101);
